import http from './index'
import qs from 'qs'
//首页轮播图
export function getBanner(){
    return http.get('/getbanner')
}

//首页商品
export function getHomeGoods(){
    return http.get('/gethortgoods')
}
//登录接口
export function Login(data){
    return http.post('/login',data)
}
//注册接口
export function Register(data){
    return http.post('/register',data)
}
// 分页商品详情
export function getCateInfo(){
    return http.get('/getcates')
}
// 商品列表
export function getCateList(params){
    return http.get('/getgoodlist',{
        params
    })
}
// 商品详情
export function getGoodsInfo(params){
    return http.get('/getgoodsinfo',{
        params
    })
}

// 购物车添加
export function cartAdd(data){
    return http.post('/cartadd',qs.stringify(data))
}
// 购物车列表
export function cartList(params){
    return http.get('/cartlist',{
        params
    }) 
}
//购物车修改
export function cartEdit(data){
    return http.post('/cartedit',qs.stringify(data))
}
 //删除购物车
export function cartDel(data){
    return http.post('/cartdelete',qs.stringify(data))
}  
//地址列表
export function addrList(params){
    return http.get('/addresslist',{
        params
    })
}

//地址添加
export function addrAdd(data){
    return http.post('/addressadd',qs.stringify(data))
}
//地址编辑

export function addrEdit(data){
    return http.post('/addressedit',qs.stringify(data))
}

//地址删除
export function addrDel(data){
    return http.post('/addressremove',qs.stringify(data))
}